package cn.wonderland.feign.client;

import cn.wonderland.config.FeignConfiguration;
import cn.wonderland.domain.User;
import cn.wonderland.fallback.UserFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-server",path = "user",
        configuration = FeignConfiguration.class,
        fallbackFactory = UserFallBackFactory.class)
public interface UserFeignClient {


    /**
     * 路径： /user/110
     * @param id 用户id
     * @return 用户
     */
    @GetMapping("/{id}")
    User queryById(@PathVariable("id") Long id);
}
